/**
 *  This code is a part of Quadratix project.
 * Copyright (C) 2009 - 2010 Valery A. Ilychev aka Sarutobi (ilychev at gmail dot com)
 * 
 *  This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */
package ru.sarutobi.quadratix.ui;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JButton;

import ru.sarutobi.quadratix.Board;

public class Fishka extends JButton {

	private int x, y;
	private Color color;

	public Fishka(int x, int y) {
		super();
		this.x = x;
		this.y = y;
		setBackground(Color.GRAY);
	}

	public void setOccup(int Occup) {
		switch (Occup) {
		case Board.WHITE:
			 color = Color.WHITE;
			break;
		case Board.BLACK:
			color = Color.BLACK;
			break;

		}
		setBackground(color);
	}
	
	@Override
	public Dimension getPreferredSize(){
		return new Dimension (30, 30);
	}

	public int getXpos() {
		return x;
	}

	public int getYpos() {
		return y;
	}

	public void higlight(){
		setBackground(Color.GRAY);
	}
}
